<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>枣阳市第二人民医院管理系统</title>
    <meta charset="UTF-8">

    <link href="Css/zui.css" rel="stylesheet" type="text/css" media="all">
    <link href="Css/login.css" rel="stylesheet" type="text/css" media="all">
    <link href="Css/verify.css" rel="stylesheet" type="text/css">

    <style> body {
        background-image: url(Images/4.jpg);
    }</style>
</head>
<body>
<div id="main-box"></div>
<div id="main-content">
    <div class="login-body  animated fadeInLeft">
        <div class="login-main pr">
            <form id="loginForm" action="" class="login-form" method="post">
                <h3> 登录系统 </h3>
                <h5 style="padding-bottom: 10px"> System Management Center </h5>
                <!-- 账号登陆 -->
                <div id="MobileBox" class="item-box">
                    <div class="input-group user-name">
                        <span class="input-group-addon">
                            <img src="Images/user.png" width="17" height="17" style="margin-top:-2px">
                        </span>
                        <input type="text" name="uLoginname" class="form-control" value="" placeholder="用户名/手机号">
                    </div>
                    <div class="input-group password">
                        <span class="input-group-addon"><img src="Images/lock.png" width="17" height="17"
                                                             style="margin-top:-2px">
                        </span>
                        <input type="password" name="uPassword" class="form-control" value="" placeholder="密码">
                    </div>

                    <div id="mpanel1"></div>


                    <div class="use-a">
                        <label>
                            <input type="checkbox" name="cb" value="cb">记住密码
                        </label>
                        <a>忘记密码？</a>
                        <a class="use-ding" href="javascript:void(0)"><img src="Images/ding.png" width="17" height="17"
                                                                           style="margin-top:-2px"> 钉钉账号登陆</a>
                    </div>
                    <!--@thymesVar id="msg" type="String"-->
                    <font id="msg" th:text="${msg}" color="#a52a2a"> </font>
                </div>
                <div class="login_btn_panel">
                    <button disabled="disabled" id="login" class=" btn btn-primary btn-block btn-lg" type="button" >登录
                    </button>
                    <div class="check-tips"></div>
                </div>
            </form>

        </div>
    </div>

</div>


<script type="text/javascript" src="Js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="Js/verify.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('#mpanel1').slideVerify({
            type: 1,		//类型
            vOffset: 5,	//误差量，根据需求自行调整
            barSize: {
                width: '100%',
                height: '40px',
            },
            ready: function () {
            },
            success: function () {
                //alert('验证成功，添加你自己的代码！');
                document.getElementById("login").disabled = false
            },
            error: function () {
                alert('验证失败！');
            }

        });
        //提交按钮的单机事件
        $('#login').click(function () {
            $.ajax({
                type: "GET",
                url: "/hospital/user/login",
                data: $('#loginForm').serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.code == 200) {
                        window.location.href = "/index.html";
                    } else {
                        $('#msg').html(data.msg)
                    }
                }
            });
        });
    });


</script>

</body>
</html>
